import request from '@/utils/request'
import { time } from 'echarts'

// 查询任务配置配置列表
export function listConfig(query) {
  return request({
    url: '/task/config/list',
    method: 'get',
    params: query
  })
}

// 查询任务配置配置详细
export function getConfig(taskConfigId) {
  return request({
    url: '/task/config/' + taskConfigId,
    method: 'get'
  })
}

// 新增任务配置配置
export function addConfig(data) {
  return request({
    url: '/task/config',
    method: 'post',
    data: data
  })
}

// 修改任务配置配置
export function updateConfig(data) {
  return request({
    url: '/task/config',
    method: 'put',
    data: data
  })
}

// 删除任务配置配置
export function delConfig(taskConfigId) {
  return request({
    url: '/task/config/' + taskConfigId,
    method: 'delete'
  })
}


//批量文件导入
export function importConfig(data) {
  return request({
    url: '/task/config/import',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

//批量文件导入总行任务
export function importConfigBankTask(data) {
  return request({
    url: '/task/config/importZh',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function importConfigSubBankPanDian(data) {
  return request({
    url: '/task/config/importFhPd',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    timeout: 300000,
    responseType: 'blob',
  })
}


// 批量启用/禁用网点摄像头配置
export function updateConfigStatus(status, equipmentId) {
  return request({
    url: '/task/config/status/'+ status + "/"+ equipmentId,
    method: 'get'
  })
}

